<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib uri="/struts-tags" prefix="s" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
 <meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>咨询信息列表</title>
    <link rel="shortcut icon"  href="images/favicon.ico"/>
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	<LINK href="<%=path %>/admin/css/admin.css" type="text/css" rel="stylesheet">
	<script type="text/javascript" src="<%=path %>/admin/js/myJs.js" charset=utf-8></script>
	<link href="<%=path %>/admin/css/myStyle.css" rel="stylesheet" type="text/css" />
	
	<script type="text/javascript" language="javascript">
		//发送请求，筛选结果
		function select(){
			var quesTitle=document.getElementById("questionId").value;
			var quesType=document.getElementById("questionType").value;
			if(quesType=="不限"){
				quesType="";
			}		
			var action="question_select.html?page.pageIndex=1&page.pageSize=15&question.quesTitle="+quesTitle+"&question.quesType="+quesType;
			window.location.href=action;
		}
		
	</script>
  </head>
  
  <body>
  <TABLE cellSpacing=0 cellPadding=0 width="95%" align=center>
  <TR height=20>
    <TD></TD></TR>
  <TR height=22>
    <TD style="PADDING-LEFT: 20px; FONT-WEIGHT: bold; COLOR: #ffffff" 
    align=middle background="<%=path %>/admin/images/title_bg2.jpg">用户列表</TD></TR>
  <TR bgColor=#ecf4fc height=12>
    <TD></TD></TR>
  <TR height=20>
    <TD></TD></TR></TABLE>
    
  <table cellSpacing=0 cellPadding=0 width="95%" align=center  class="tableborder" id="table1" style="color:#666;border-left:0;">
   <tr align="right"  style="border:0px;">
		<td colspan="9" style="border:0px;">
			筛选&nbsp;&nbsp;&nbsp;&nbsp;	
			咨询标题：<input type="text" name="question.quesTitle" id="questionId" />
			审核状态：<select name="question.quesType" id="questionType">
							<option value="不限">不限</option>
							<option value="已回答">已回答</option>
							<option value="通过">未回答</option>
							<option value="关闭">关闭</option>
							
					  </select>
				<button type="button" onclick="select();" class="allDelete">筛选</button>
		</td>
	</tr>
	
   <tr align="center"  style="color:#0066CC;">
		<th>选择</th><th>咨询标题</th><th>咨询日期</th><th width="200px;" style="overflow: hidden;">咨询回答</th><th>操作</th>
	</tr>
	<s:iterator value="#attr.questionList" id="ques" >
   	<tr align="center" >
		<td><input type="checkbox" value="<s:property value="#ques.quesId" />" id="questionId" name="questionId" /></td>
		<td><s:property value="#ques.quesTitle" /></td>
		<td><s:property value="#ques.quesDate" /></td>
		
		<c:if test="${empty ques.quesAnswer }">
			<td align="center">
			<span style="color:red;">暂时还没有回答</span>
			</td>
		</c:if>
		<c:if test="${not empty ques.quesAnswer }">
		<td align="center">
			<div style="width:200px; height:1.5em;overflow: hidden;">
				<s:property value="#ques.quesAnswer" escape="false" />
			</div>
		</td>
		</c:if>
		
		<td>		
			<a href="question_showDetail.html?question.quesId=<s:property value="#ques.quesId" />">[详细]</a>
			<c:if test="${empty ques.quesAnswer }">
			<c:if test="${ques.quesType ne '关闭' }">
			<a href="question_preAnswer.html?question.quesId=<s:property value="#ques.quesId" />">[回答]</a>
			</c:if>
			<c:if test="${ques.quesType eq '关闭' }">
			[回答]
			</c:if>
			[修改回答]
			</c:if>
			<c:if test="${not empty ques.quesAnswer }">
			[回答]
			<a href="question_preUpAnswer.html?question.quesId=<s:property value="#ques.quesId" />">[修改回答]</a>
			</c:if>
			<c:if test="${ques.quesType eq '关闭' }">
				[关闭]
			</c:if>
			<c:if test="${ques.quesType ne '关闭' }">
				<a href="question_updateState.html?question.quesId=<s:property value="#ques.quesId" />">[关闭]</a>
			</c:if>	
			<a href="question_deleteQuestion.html?question.quesId=<s:property value="#ques.quesId" />" onclick="return confirm('确认删除？')">[删除]</a>
		</td>
	</tr>
	</s:iterator>
	<tr align="center">
		<td><input type="checkbox" value="全选" id="selectAll" onclick="selectAll(this.checked,'questionId');" /></td>
		<td colspan="4" align="left">
			<button type="button" class="allDelete" onclick="deleteAll('question_deleteMore.html','questionId');">删除选中</button>
		</td>
	</tr>
	<tr align="center">
		<td colspan="5">
			<s:property value="#attr.link" escape="false"/>
		</td>
	</tr>
  </table>


  </body>
</html>
